package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.HotelRoom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DutyBillMapper;
import com.ruoyi.system.domain.DutyBill;
import com.ruoyi.system.service.IDutyBillService;

/**
 * 值班账单Service业务层处理
 * 
 * @author txy
 * @date 2022-02-10
 */
@Service
public class DutyBillServiceImpl implements IDutyBillService 
{
    @Autowired
    private DutyBillMapper dutyBillMapper;

    /**
     * 查询值班账单
     * 
     * @param billId 值班账单主键
     * @return 值班账单
     */
    @Override
    public DutyBill selectDutyBillByBillId(String billId)
    {
        return dutyBillMapper.selectDutyBillByBillId(billId);
    }

    /** 
     * @description: 查询全部值班账单
     * @param: dutyBill 
     * @return: java.util.List<com.ruoyi.system.domain.DutyBill> 
     * @author TXY
     * @date: 2022/2/10 9:39
     * @param HotelRoom
     */ 
    @Override
    public List<HotelRoom> selectDutyBillListAll(HotelRoom HotelRoom) {
        return dutyBillMapper.listAll(HotelRoom);
    }

    /**
     * 查询值班账单列表
     * 
     * @param dutyBill 值班账单
     * @return 值班账单
     */
    @Override
    public List<DutyBill> selectDutyBillList(DutyBill dutyBill)
    {
        return dutyBillMapper.selectDutyBillList(dutyBill);
    }

    /**
     * 新增值班账单
     * 
     * @param dutyBill 值班账单
     * @return 结果
     */
    @Override
    public int insertDutyBill(DutyBill dutyBill)
    {
        dutyBill.setBillId(DateUtils.dateTimeNow());
        dutyBill.setRootStatus("2");
        return dutyBillMapper.insertDutyBill(dutyBill);
    }

    /**
     * 修改值班账单
     * 
     * @param dutyBill 值班账单
     * @return 结果
     */
    @Override
    public int updateDutyBill(DutyBill dutyBill)
    {
        return dutyBillMapper.updateDutyBill(dutyBill);
    }

    /**
     * 批量删除值班账单
     * 
     * @param billIds 需要删除的值班账单主键
     * @return 结果
     */
    @Override
    public int deleteDutyBillByBillIds(String[] billIds)
    {
        return dutyBillMapper.deleteDutyBillByBillIds(billIds);
    }

    /**
     * 删除值班账单信息
     * 
     * @param billId 值班账单主键
     * @return 结果
     */
    @Override
    public int deleteDutyBillByBillId(String billId)
    {
        return dutyBillMapper.deleteDutyBillByBillId(billId);
    }
}
